﻿using CommunityToolkit.Mvvm.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using System.Configuration;
using System.Data;
using System.Windows;
using XiaFControl.Demo.ViewModels;

namespace XiaFControl.Demo
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            this.Startup += App_Startup;
        }

        private void App_Startup(object sender, StartupEventArgs e)
        {
            //设置多语言
            //LangProvider.Culture = new CultureInfo("zh-CN");
            ServiceCollection serviceDescriptors = new ServiceCollection();
            serviceDescriptors.AddTransient<MainViewModel>();
            serviceDescriptors.AddTransient<InputViewModel>();
            serviceDescriptors.AddTransient<ListsViewModel>();
            serviceDescriptors.AddTransient<TabControlViewModel>();
            serviceDescriptors.AddTransient<MessageBoxViewModel>();
            serviceDescriptors.AddTransient<DialogContentViewModel>(); 
            //serviceDescriptors.AddTransient<IDialogService, DialogService>() //Services
            //serviceDescriptors.AddSingleton(RestService.For<IContactsService>("https://randomuser.me/"))
            Ioc.Default.ConfigureServices(serviceDescriptors.BuildServiceProvider());
        }
    }

}
